<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>&nbsp;</title>
    </head>
    <body>

        <#if user??>
            <form id="fm" method="post" action="sys/user/update">
            <input name="id" type="hidden" value="${(user.id)!}">
        <#else>
            <form id="fm" method="post" action="sys/user/add">
            <input name="type" type="hidden" value="1">
        </#if>
        
                <div style="margin-bottom:10px">
                    <input class="easyui-textbox" name="uname" style="width:100%" value="${(user.uname)!''}" data-options="label:'昵称:',required:true">
                </div>
                <div style="margin-bottom:10px">
                    <#if user??>
                       <input class="easyui-passwordbox" name="upass" style="width:100%" value="${(user.upass)!}" data-options="label:'密码:',required:true,editable:false">
                    <#else>
                        <input class="easyui-passwordbox" name="upass" style="width:100%" value="${(user.upass)!}" data-options="label:'密码:',required:true">
                    
                    </#if>
                    
                </div>
                <div style="margin-bottom:10px">
                    <input class="easyui-numberbox" name="mobile" style="width:100%" value="${(user.mobile)!}" data-options="label:'手机号:',required:true">
                </div>
        </form>
        <div style="text-align:center;padding:5px">
            <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()" style="width:80px">保存</a>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <#if user??>
                          <td align="center"><a href="javascript:void(0)" class="easyui-linkbutton" onclick="closeForm()" style="width:80px">关闭</a></td>
                       <#else>
                           <td align="center"><a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()" style="width:80px">重置</a></td>
                       </#if>
        </div>
       
       <script type="text/javascript">
            function submitForm(){
                $('#fm').form('submit',{
                	success:function(r){
                		$('#form').dialog('close');
                	}
                });
            }
            function clearForm(){
                $('#fm').form('clear');
            }
            function closeForm(){
            	$('#form').dialog('close');
            }
       </script>
    </body>
     
</html>